-
Notifications
You must be signed in to change notification settings - Fork 421
chore(ci): source code tampering protection for release #2301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(ci): source code tampering protection for release #2301
Conversation
Uses new mechanism to seal source code, run quality checks separately, and always reuses sealed source code in every step to prevent source code tampering. It documents every job purpose, and creates a new faster action to upload and download artifacts.
Reviewing now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super good job, TIL that you can have your own custom actions on the same repo. Just left some questions and a tiny comment.
# NOTES | ||
# | ||
# Upload-artifact and download-artifact takes ~2m40s to upload 8MB | ||
# so this is custom action cuts down the entire operation to 1s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Co-authored-by: Ruben Fonseca <[email protected]> Signed-off-by: Heitor Lessa <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing!
@rubenfonseca gonna need your review one more time as I've added a hash verifier as per @leandrodamascena ask. Leandro reviewed |
Successful run publishing to Test PyPi repo (minus layers for good reasons and no change there): https://github.com/heitorlessa/aws-lambda-powertools-test/actions/runs/5053853611 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APPROVED!! Amazing work @heitorlessa!
Aleluia! <3 |
Issue number: #2206
Summary
Implements mechanism to seal source code, further break
build
job, further isolaterelease
job with binaries only, and fixes the Git Tag creation process.Changes
bump_version
andcreate_tag
to use sealed source code with version bumpedubuntu-latest
as we no longer need those 4 cores (savings!!)pyproject.toml
in case sealed source code is incorrectAdditional fixes
create_tag
as it needs to add staged changes before pushing... otherwise it pushes the current commitThreats to address
RELEASE_COMMIT
during checkoutseal
job to hash and reuse artifact throughout releasepipx install git+<url+SHA>
for poetry to prevent rogue package managerrelease-<build-hash>
for traceability and immutabilitypipx install git+<url+SHA>
for poetry to prevent rogue package managerrelease
job doesn't install any dependencies but a pinnedpoetry
seal
job to hash and reuse artifactpyproject.toml
that changed inseal
to our local git tree, then push that with the new tag only. This also solves the data race condition where PR is only merged later and our tag uses an older version.release
environmentrelease
environment requires manual approval before proceedingUser experience
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.